Skip to content

Update all examples to Terminal.Gui 2.5.x (MEC configuration, post-#5416) - #4

Open
tig wants to merge 2 commits into
mainfrom
tig/update-to-2.5
Open

Update all examples to Terminal.Gui 2.5.x (MEC configuration, post-#5416)#4
tig wants to merge 2 commits into
mainfrom
tig/update-to-2.5

Conversation

@tig

@tig tig commented Aug 22, 2026

Copy link
Copy Markdown
Member

Ports every example to the Terminal.Gui 2.5 configuration model introduced by tui-cs/Terminal.Gui#5416 (legacy ConfigurationManager removed, MEC-based TuiConfigurationBuilder).

Depends on

Code changes

  • Removed ConfigurationManager.Enable (ConfigLocations.All) from all examples — 2.5 applies configuration automatically at assembly load.
  • Example: theme override now via TuiConfigurationBuilder.Shared.RuntimeConfig + ApplyToStaticFacades ().
  • ReactiveExample: the ObservableEvents source generator cannot wrap 2.5's TextField (it hides View.TextChanging with a different delegate type, generator emits CS0123); the two TextField.TextChanged subscriptions now use Observable.FromEventPattern. Button .Events ().Accepting wrappers still work.
  • FSharpExample: ported from the v1 API to v2 (v2 namespaces, IApplication model, F# 9 nullness handling) and added to the solution.

Config/JSON changes

  • Config/example_config.json, Config/macos.json, Config/windows.json, Themes/code-dark.config.json migrated to the nested MEC shape with Tools/MigrateConfig (dotted keys and Themes/Schemes arrays no longer apply in 2.5).
  • Key bindings remain config-driven via nested Application:DefaultKeyBindings, View:DefaultKeyBindings, View:ViewKeyBindings (per-command overlay; unmentioned commands keep compile-time defaults).
  • Dropped the removed ConfigurationManager.ThrowOnJsonErrors key; fixed a mojibake check-mark glyph.
  • READMEs for CommunityToolkit/Reactive/SelfContained/Config/FSharp rewritten (updated snippets; the old files had no line endings at all and mojibake characters).

Verification

Verified against a locally packed 2.5.0-develop.1 from the current tig/remove-cm-followup branch (isolated NuGet cache):

  • Examples.sln (12 projects) + FSharpExample: build clean, 0 warnings / 0 errors
  • All 9 smoke tests pass (each example launches, renders, exits cleanly)
  • dotnet format --verify-no-changes: byte-identical violation list to main under SDK 10.0.400 (46 pre-existing, environmental) — no new violations introduced

🤖 Generated with Claude Code

https://claude.ai/code/session_01NGq38GbuZPAEa5wZHkmPiZ

tig and others added 2 commits August 22, 2026 17:29
…416).

Ports every example off the legacy ConfigurationManager API removed by
tui-cs/Terminal.Gui#5416 and onto the 2.5 MEC-based model:

- Remove ConfigurationManager.Enable (ConfigLocations.All) everywhere —
  configuration is applied automatically at assembly load in 2.5.
- Example: RuntimeConfig theme override now uses
  TuiConfigurationBuilder.Shared.RuntimeConfig + ApplyToStaticFacades.
- ReactiveExample: the ObservableEvents source generator cannot wrap 2.5's
  TextField (it hides View.TextChanging with a different delegate type);
  subscribe to TextField.TextChanged via Observable.FromEventPattern instead.
- Migrate Config/*.json and Themes/code-dark.config.json to the nested MEC
  shape (dotted keys and Themes/Schemes arrays no longer apply). Key bindings
  stay supported via nested Application:DefaultKeyBindings,
  View:DefaultKeyBindings, and View:ViewKeyBindings with per-command overlay.
- Drop the removed ConfigurationManager.ThrowOnJsonErrors key and fix a
  mojibake check-mark glyph in example_config.json.
- Port FSharpExample to the v2 API (v2 namespaces, IApplication model,
  F# 9 nullness) and add it to the solution.
- Rewrite the CommunityToolkit/Reactive/SelfContained/Config READMEs
  (updated snippets; the old files had no line endings and mojibake).
- Bump Terminal.Gui to 2.5.0-develop.* (floats once 2.5 dev packages
  publish after tui-cs/Terminal.Gui#5416 merges).

Verified against a locally packed 2.5.0-develop.1 from the #5416 branch:
solution + FSharpExample build with 0 warnings/0 errors, and all 9 smoke
tests pass. dotnet format verify reports only the 46 violations already
present on main under SDK 10.0.400.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NGq38GbuZPAEa5wZHkmPiZ
…ys, F# smoke test.

- Config/macos.json and windows.json: trim to only the commands they actually
  change (2.5's per-command overlay keeps defaults for omitted commands);
  drop windows.json's Quit row (it restated the compile-time default).
- Config/README.md: correct the default-binding tables against the 2.5 source
  (Quit is Esc on all platforms; DeleteCharRight includes Ctrl+D by default),
  and document that a binding cannot be removed via config — windows.json
  cannot disable Suspend; use Application.RemoveDefaultKeyBinding in code.
- Examples.sln: revert the auto-generated x64/x86 platform churn (~120 lines);
  add FSharpExample and the previously missing Examples.SmokeTests rows as
  plain Any CPU entries, so solution builds stop silently skipping the tests.
- SelfContained/README.md: snippet now matches the code (Accepted event, and
  the AppModel.Inline line the example exists to demonstrate).
- ReactiveExample/README.md: scope the .Events () caveat correctly (works for
  other views, never for TextField) and show the IValue ValueChanged binding.
- ReactiveExample/LoginView.cs: replace the two duplicated FromEventPattern
  pipelines with one ObserveText helper over IValue<string>.ValueChanged.
- FSharpExample: add a --smoke-test mode and cover it in Examples.SmokeTests
  (now 10 tests, all passing); fix a space-before-parens miss.

The 2.5.0-develop.* floating version is intentionally left as the merge gate
until Terminal.Gui#5416 publishes packages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NGq38GbuZPAEa5wZHkmPiZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant